/**
 * Copyright &copy; 2012-2014 <a href="https://github.cn.apestar">JeeSite</a> All rights reserved.
 */
package cn.apestar.modules.sys.entity;

import org.hibernate.validator.constraints.Length;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import cn.apestar.common.persistence.DataEntity;

/**
 * 消息方案Entity
 * @author LVH
 * @version 2015-12-22
 */
public class SysMessage extends DataEntity<SysMessage> {
	
	private static final long serialVersionUID = 1L;
	private String msgType;		// msg_type
	private String fromU;		// from_u
	private String toU;		// to_u
	private String content;		// content
	private Date msgTime;		// msg_time
	private String msgState;		// msg_state
	private String source;		// source
	private String target;		// target
	
	public SysMessage() {
		super();
	}

	public SysMessage(String id){
		super(id);
	}

	@Length(min=0, max=1, message="msg_type长度必须介于 0 和 1 之间")
	public String getMsgType() {
		return msgType;
	}

	public void setMsgType(String msgType) {
		this.msgType = msgType;
	}
	
	@Length(min=0, max=64, message="from_u长度必须介于 0 和 64 之间")
	public String getFromU() {
		return fromU;
	}

	public void setFromU(String fromU) {
		this.fromU = fromU;
	}
	
	@Length(min=0, max=64, message="to_u长度必须介于 0 和 64 之间")
	public String getToU() {
		return toU;
	}

	public void setToU(String toU) {
		this.toU = toU;
	}
	
	@Length(min=0, max=256, message="content长度必须介于 0 和 256 之间")
	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}
	
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	public Date getMsgTime() {
		return msgTime;
	}

	public void setMsgTime(Date msgTime) {
		this.msgTime = msgTime;
	}
	
	@Length(min=0, max=1, message="msg_state长度必须介于 0 和 1 之间")
	public String getMsgState() {
		return msgState;
	}

	public void setMsgState(String msgState) {
		this.msgState = msgState;
	}
	
	@Length(min=0, max=64, message="source长度必须介于 0 和 64 之间")
	public String getSource() {
		return source;
	}

	public void setSource(String source) {
		this.source = source;
	}
	
	@Length(min=0, max=64, message="target长度必须介于 0 和 64 之间")
	public String getTarget() {
		return target;
	}

	public void setTarget(String target) {
		this.target = target;
	}
	
}